package org.example.Future;


import java.util.concurrent.TimeUnit;

/*
真实数据类
 */
public class RealDate implements Date{

    private String result;

    public RealDate(String queryStr) {
        System.out.println("根据"+queryStr +"进行查询，这个是一个耗时的操作");
        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("操作完毕");
        this.result = "张三";
    }

    @Override
    public String getRequest() {
        return result;
    }
}
